﻿using System;
using CID.Domain.Users;
using CID.Support.Exceptions;

namespace CID.Execution.Controller.Exceptions
{
    [Serializable]
    class UserActionUnauthorizedException : BaseException
    {
        public UserActionUnauthorizedException(string action, params UserRole[] requiredRoles)
            : base(String.Format("The user is not authorized to perform the {0} action. It misses one of the following Roles:{1}.", action, String.Join(", ", requiredRoles)))
        {
        }
    }
}
